/*
* Copyright (c) 2007 by Kirill Kolodyazhniy.
* See the file "license.terms" for information on usage and redistribution.
*/

#ifndef M_FACTORY_H
#define M_FACTORY_H

#include "refptr.h"

#include <string>

namespace Engine
{
	/**
	*   Abstract factory class.
	*/
	template<class T>
	class Factory
	{
	public:
		virtual ~Factory() {};

		/**
		*   Returns the factory type.
		*/
		virtual const std::string& GetType() const = 0;

		/**
		*   Creates a new object.
		*   @param name Name of the object to create
		*   @return	An object created by the factory. The type of the object depends on	the factory.
		*/
		virtual T* CreateInstance( const std::string& name ) = 0;
	};
}

#endif

